package com.household.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.household.domain.enums.OrderDeleteEnum;
import com.household.domain.enums.OrderStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * Created By wanzhen
 * 2023. 2023/4/4. 19:31
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Orders {
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

//    用户id
    private String userId;

//    家政公司id
    private String companyId;

//    服务id
    private String serviceId;

//    订单状态
    private OrderStatusEnum state;

//    订单价格
    private Double price;


//    订单描述
    private String description;

//    服务地址
    private String serviceAddress;

//    创建时间
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createDate;

//    更新时间
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateDate;

    //    逻辑删除
    @TableLogic
    private Integer isDeleted;

//    订单删除原因
    private OrderDeleteEnum deleteType;

    //    乐观锁
    @Version
    private Integer version;

}
